29 research outputs found
A trustworthy framework for resource-aware embedded programming
Funding: EU Horizon 2020 project, TeamPlay (https://www.teamplay-h2020.eu), grant number 779882; UK EPSRC Discovery, grant number EP/P020631/1.Systems with non-functional requirements, such as Energy, Time and Security (ETS), are of increasing importance due to the proliferation of embedded devices with limited resources such as drones, wireless sensors, and tablet computers. Currently, however, there are little to no programmer supported methodologies or frameworks to allow them to reason about ETS properties in their source code. Drive is one such existing framework supporting the developer by lifting non-functional properties to the source-level through the Contract Specification Language (CSL), allowing non-functional properties to be first-class citizens, and supporting programmer-written code-level contracts to guarantee the non-functional specifications of the program are met. In this paper, we extend the Drive system by providing rigorous implementations of the underlying proof-engine, modeling the specification of the annotations and assertions from CSL for a representative subset of C, called Imp. We define both an improved abstract interpretation that automatically derives proofs of assertions, and define inference algorithms for the derivation of both abstract interpretations and the context over which the interpretation is indexed. We use the dependently-typed programming language, Idris, to give a formal definition, and implementation, of our abstract interpretation. Finally, we show our well-formed abstract interpretation over some representative exemplars demonstrating provable assertions of ETS.Postprin
Pattern discovery for parallelism in functional languages
No longer the preserve of specialist hardware, parallel devices
are now ubiquitous. Pattern-based approaches to parallelism,
such as algorithmic skeletons, simplify traditional low-level
approaches by presenting composable high-level patterns of
parallelism to the programmer. This allows optimal parallel
configurations to be derived automatically, and facilitates the
use of different parallel architectures. Moreover, parallel patterns
can be swap-replaced for sequential recursion schemes,
thus simplifying their introduction. Unfortunately, there is no
guarantee that recursion schemes are present in all functional
programs. Automatic pattern discovery techniques can be used
to discover recursion schemes. Current approaches are limited
by both the range of analysable functions, and by the range of
discoverable patterns. In this thesis, we present an approach
based on program slicing techniques that facilitates the analysis
of a wider range of explicitly recursive functions. We then
present an approach using anti-unification that expands the
range of discoverable patterns. In particular, this approach is
user-extensible; i.e. patterns developed by the programmer can
be discovered without significant effort. We present prototype
implementations of both approaches, and evaluate them on
a range of examples, including five parallel benchmarks and
functions from the Haskell Prelude. We achieve maximum
speedups of 32.93x on our 28-core hyperthreaded experimental
machine for our parallel benchmarks, demonstrating
that our approaches can discover patterns that produce good
parallel speedups. Together, the approaches presented in this
thesis enable the discovery of more loci of potential parallelism
in pure functional programs than currently possible.
This leads to more possibilities for parallelism, and so more
possibilities to take advantage of the potential performance
gains that heterogeneous parallel systems present
Towards semi-automatic data-type translation for parallelism in Erlang
As part of our ongoing research programme into programmer-in-the-loop parallelisation, we are studying the problem of introducing alternative data structures to support parallelism. Automated support for data structure transformations makes it easier to produce the best parallelisation for some given program, or even to make parallelisation feasible. We use a refactoring approach to choose and introduce these transformations for specific algorithmic skeletons, structured forms of parallelism that capture common patterns of parallelism. Our approach integrates with the Wrangler refactoring tool for Erlang, and uses the advanced Skel [4] skeleton library for Erlang. This library has previously been shown to give good parallelisations for a number of applications, including a multi-agent system [1] where we have achieved speedups of up to 142.44 on a 61-core machine with 244 threads. We have investigated three widely-used Erlang data structures: lists, binary structures and ETS (Erlang Term Storage) tables. In general, we have found that ETS tables deliver the best parallel performance for the examples that we have considered. However, our results show that simple lists may deliver similar performance to the use of ETS tables, and better performance than using binary structures. This means that we cannot blindly choose to implement a single optimisation as part of the compilation process. Our approach also allows the use of new (possibly user-defined) data structures and other transformations in future, giving a high level of flexibility and generality.Postprin
Proving renaming for Haskell via dependent types : a case-study in refactoring soundness
We present a formally verified refactoring framework for a subset of Haskell 98. Our framework is implemented in the dependently-typed language, Idris, which allows us to encode soundness proofs as an integral part of the implementation. We give the formal definition of our static semantics for our Haskell 98 subset, which we encode as part of the AST, ensuring that only well-formed programs may be represented and transformed. This forms a foundation upon which refactorings can be formally specified. We then define soundness of refactoring implementations as conformity to their specification. We demonstrate our approach via renaming, a canonical and well-understood refactoring, giving its implementation alongside its formal specification and soundness proof.Postprin
Restoration of legacy parallelism in C and C++ applications
Parallel patterns are a high-level programming paradigm that enables non-experts in parallelism to develop structured parallel programs that are maintainable, adaptive, and portable whilst achieving good performance on a variety of parallel systems. However, there still exists a large base of legacy-parallel code developed using ad-hoc methods and incorporating low-level parallel/concurrency libraries such as pthreads without any parallel patterns in the fundamental design. This code would benefit from being restructured and rewritten into pattern-based code. However, the process of rewriting the code is laborious and error-prone, due to typical concurrency and pthreading code being closely intertwined throughout the business logic of the program. In this paper, we present a new software restoration methodology, to transform legacy-parallel programs implemented using e.g. pthreads into structured patterned equivalents. We demonstrate our restoration technique on a number of benchmarks, allowing the introduction of patterned parallelism in the resulting code; we record improvements in cyclomatic complexity and speedups.PostprintPeer reviewe
In search of a map : using program slicing to discover potential parallelism in recursive functions
Funding: EU FP7 grant âParallel Patterns for Adaptive Heterogeneous Multicore Systemsâ (ICT-288570), by the EU H2020 grant âRePhrase: Refactoring Parallel Het- erogeneous Resource-Aware Applications â a Software Engineering Approachâ (ICT-644235), by COST Action IC1202 (âTiming Analysis on Code-Levelâ), by the EPSRC grant âDiscovery: Pattern Discovery and Program Shaping for Manycore Systemsâ (EP/P020631/1), and by Scottish Enterprise grant PS7305CA44.Recursion schemes, such as the well-known map, can be used as loci of potential parallelism, where schemes are replaced with an equivalent parallel implementation. This paper formalises a novel technique, using program slicing, that automatically and statically identifies computations in recursive functions that can be lifted out of the function and then potentially performed in parallel. We define a new program slicing algorithm, build a prototype implementation, and demonstrate its use on 12 Haskell examples, including benchmarks from the NoFib suite and functions from the standard Haskell Prelude. In all cases, we obtain the expected results in terms of finding potential parallelism. Moreover, we have tested our prototype against synthetic benchmarks, and found that our prototype has quadratic time complexity. For the NoFib benchmark examples we demonstrate that relative parallel speedups can be obtained (up to 32.93x the sequential performance on 56 hyperthreaded cores).Postprin
Semi-automatic ladderisation : improving code security through rewriting and dependent types
Funding: This work was generously supported by the EU Horizon 2020 project, TeamPlay (https://www.teamplay-h2020.eu), grant number 779882, and UK EPSRC, Energise, grant number EP/V006290/1.Cyber attacks become more and more prevalent every day.An arms race is thus engaged between cyber attacks and cyber defences.One type of cyber attack is known as a side channel attack, where attackers exploit information leakage from the physical execution of a program, e.g. timing or power leakage, to uncover secret information, such as encryption keys or other sensitive data. There have been various attempts at addressing the problem of side-channel attacks, often relying on various measures to decrease the discernibility of several code variants or code paths. Most techniques require a high-degree of expertise by the developer, who often employs ad hoc, hand-crafted code-patching in an attempt to make it more secure. In this paper, we take a different approach: building on the idea of ladderisation, inspired by Montgomery Ladders. We present a semi-automatic tool-supported technique, aimed at the non-specialised developer, which refactors (a class of) C programs into functionally (and even algorithmically) equivalent counterparts with improved security properties. Our approach provides refactorings that transform the source code into its ladderised equivalent, driven by an underlying verified rewrite system, based on dependent types. Our rewrite system automatically finds rewritings of selected C expressions, facilitating the production of their equivalent ladderised counterparts for a subset of C. Using our tool-supported technique, we demonstrate our approach on a number of representative examples from the cryptographic domain, showing increased security.Postprin
Extending the âOpen-Closed Principleâ to automated algorithm configuration
Metaheuristics are an effective and diverse class of optimization algorithms: a means of obtaining solutions of acceptable quality for otherwise intractable problems. The selection, construction, and configuration of a metaheuristic for a given problem has historically been a manually intensive process based on experience, experimentation, and reasoning by metaphor. More recently, there has been interest in automating the process of algorithm configuration. In this paper, we identify shared state as an inhibitor of progress for such automation. To solve this problem, we introduce the Automated Open Closed Principle (AOCP), which stipulates design requirements for unintrusive reuse of algorithm frameworks and automated assembly of algorithms from an extensible palette of components. We demonstrate how the AOCP enables a greater degree of automation than previously possible via an example implementation.PostprintPeer reviewe
Reasoning about non-functional properties using compiler intrinsic function annotations
Funding: European Unionâs Horizon 2020 research and innovation programme under grant agreement No 779882.Embedded systems often need to adhere to time and energy constraints. With the increasing popularity of embed-ded systems, the interest in evaluating and optimizing non-functional properties like execution time and energy of these systems is increasing. In this paper, we describe a Resource-usage Estimate Expression Language (REEL), which allows the user to arguea bout these properties, within the source code, in a compiler understandable manner. Furthermore, we discuss the integration of REEL within a compiler framework. We, also show the propagation of REEL annotations within the compiler, and how they can be exploited to make decisions based on the non-functional properties within the source code. Finally, we explore REELâs potential to perform ILP-based optimizations.Postprin
Multiple novel prostate cancer susceptibility signals identified by fine-mapping of known risk loci among Europeans
Genome-wide association studies (GWAS) have identified numerous common prostate cancer (PrCa) susceptibility loci. We have
fine-mapped 64 GWAS regions known at the conclusion of the iCOGS study using large-scale genotyping and imputation in
25 723 PrCa cases and 26 274 controls of European ancestry. We detected evidence for multiple independent signals at 16
regions, 12 of which contained additional newly identified significant associations. A single signal comprising a spectrum of
correlated variation was observed at 39 regions; 35 of which are now described by a novel more significantly associated lead SNP,
while the originally reported variant remained as the lead SNP only in 4 regions. We also confirmed two association signals in
Europeans that had been previously reported only in East-Asian GWAS. Based on statistical evidence and linkage disequilibrium
(LD) structure, we have curated and narrowed down the list of the most likely candidate causal variants for each region.
Functional annotation using data from ENCODE filtered for PrCa cell lines and eQTL analysis demonstrated significant
enrichment for overlap with bio-features within this set. By incorporating the novel risk variants identified here alongside the
refined data for existing association signals, we estimate that these loci now explain âŒ38.9% of the familial relative risk of PrCa,
an 8.9% improvement over the previously reported GWAS tag SNPs. This suggests that a significant fraction of the heritability of
PrCa may have been hidden during the discovery phase of GWAS, in particular due to the presence of multiple independent
signals within the same regio